<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/includes/config.inc.php');
include_once("config.php");
$_SESSION['username'] = 'kpeterson5';
getConfig();
checkActiveLogin();
getUserInfo();

$sql = "SELECT * FROM `tbLoanReceipts` WHERE `sReceiptId` = :id";
$q = db::Query($sql, array(':id'=>$_GET['id']));
$row = $q->fetch();

?>
<title>Technology Software Loan Receipt</title>
<body>
<div style="position:absolute; top:10; right:20; text-align:center; font-weight:bold; font-size:18px">
Receipt ID:<br/>
<?php echo $row['sReceiptId'] ?>
</div>
<b>
    <center>
        Edison State College<br />
        College Administrative Procedures<br />
        Division of Technology Services<br />
        <br />
        Technology Services Division Equipment Loan Program
    </center>
    <hr />
    <br>
    <br>
    <table>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $row['sFname']." ".$row['sLname'] ?></td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $row['sDepartment'] ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Requestor's Name</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Department/Divison - Campus</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo $row['sPhone'] ?></td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo date("F d, Y", strtotime($row['sDate'])) ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Office Phone Number</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Check-Out Date</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px">&nbsp;</td>
            <td width="30px">&nbsp;</td>
            <td style="border-bottom:solid; border-bottom-width:1px" width="500px"><?php echo date("F d, Y", $row['sDue']) ?></td>
        </tr>
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Director or VP Approval</b></td>
            <td width="30px">&nbsp;</td>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Return Date</b></td>
        </tr>
        <tr>
            <td colspan="3">&nbsp;</td>
        </tr>
        <tr>
            <td style="border-bottom:solid; border-bottom-width:1px" colspan="3"><b>Academic/Business Purpose:</b> <?php echo $row['sPurpose'] ?></td>
        </tr>
    </table>
    <br />
    <table width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td><b>&nbsp;&nbsp;&nbsp;Equipment Issued</b></td>
            <td width="100px" style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;">&#8730; = Issued</td>
            <td width="100px" style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;">&#8730; = Returned</td>
        </tr>
            <?php
			$sql2 = "SELECT * FROM `tbLoanLink` WHERE `sReceiptId` = :id";	
			$q2 = db::Query($sql2, array(':id'=>$_GET['id']));
			while($row2 = $q2->fetch()){
				$sql = "SELECT * FROM `tbHardware` WHERE `iItemID` = :id ORDER BY `sMain` DESC";
				$q = db::Query($sql, array(':id'=>$row2['sItemIdentifier']));
				while($row3 = $q->fetch()){
                    ?>
        <tr>
            <td style="border:solid; border-width:1px; padding-top:5px; padding-bottom:5px; padding-left:5px;"><?php echo $row3['sDescription'] ?></td>
            <td width="100px" align="center" style="border:solid; border-width:1px;">&#8730;</td>
            <td width="100px" style="border:solid; border-width:1px;">&nbsp;</td>
        </tr>
                    <?php };
            }; ?>
    </table><br />
    I have read the Technology Services Division Equipment Loan Program Procedure.  By signing below, I certify that the equipment indicated above was checked-out/checked-in as indicated and hereby agree to abide be the terms stated in the Technology Services Division Equipment Loan Program Procedure and will provide proper care according to the guidelines.  I understand that the department of the signed employee is assuming financial reponibility for the equipment.
    <table>
        <tr>
            <td><br />
                <b>CHECK-OUT:</b><br><br>
                ___________________________<br>
                Date Checked Out<br><br>
                ___________________________<br>
                <?php echo $row['sFname']." ".$row['sLname'] ?>'s Signature
            </td>

            <td width="90">
            </td>
            <td>
                <b>CHECK-IN:</b><br><br>
                ___________________________<br>
                Date Checked In<br><br>
                ___________________________<br>
                <?php getUserInfo($row['sUname']); ?>
                <?php echo $USER['sFname']." ".$USER['sLname'] ?> - Tech Center SA
            </td>
        </tr>
    </table>
</body>
<script>
    window.print();
</script>